package com.zhuoyue.biz.core.api.dto.rep;

import com.zhuoyue.biz.core.api.domain.Geofencing;
import com.zhuoyue.biz.core.api.domain.custom.GeofencingMessageDO;
import com.zhuoyue.biz.core.api.domain.custom.HomeAndSceneDO;
import lombok.*;
import org.springframework.beans.BeanUtils;


/**
 * @author wjming
 * @ClassName: Geofencing
 * @Description: 地理栅栏数据库对象信息
 * @Date 2021-07-06 13:10
 */
@Data
public class GeofencingRepDTO extends BaseRepDTO {
    /**
     * 网关ID
     */
    private String gatewayId;

    /**
     * 家庭ID
     */
    private String homeId;

    /**
     * 执行名称
     */
    private String name;

    /**
     * 场景ID
     */
    private String sceneId;

    /**
     * 场景名称
     */
    private String sceneName;
    /**
     * 场景图片
     */
    private String sceneImage;

    /**
     * 离家距离
     */
    private Double distance;

    /**
     * 使能判断
     */
    private Boolean enable;

    /**
     * 周一到周日ListString
     * "[0]"
     * "[1,2,3,4,5,6,7]"
     */
    private String time;
    /**
     * 类型 0,圈内，1圈外
     */
    private String type;

    /**
     * 数据层转化为DTO层
     *
     * @param geofencing
     * @return
     */
    public GeofencingRepDTO geofencingToRepDTO(GeofencingMessageDO geofencing) {
        BeanUtils.copyProperties(geofencing, this);
        return this;
    }

}